package com.example.controller;

import com.example.pojo.User;
import com.example.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by wsk1103 on 2017/5/6.
 */
@Controller
@RequestMapping("wsk")
public class UserController {
    @Autowired
    private UserService userService;

    @RequestMapping("/{id}")
    @ResponseBody
    public User getUserById(@PathVariable("id") int id) {
        User user = userService.findOne(id);
        return user;
    }
    @RequestMapping("/ee")
    public String ee(){
        return "index";
    }
}
